package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 其他参数
 */
@Controller
public class OtherParamController {

    @RequestMapping("request1")
    @ResponseBody
    public BaseRespVo request1(HttpServletRequest request,
                               HttpServletResponse response) {
        return BaseRespVo.ok();
    }

    @RequestMapping("request2")
    public String request2(Model model) {
        return "/hello.jsp";
    }

    @RequestMapping("request3")
    @ResponseBody
    public BaseRespVo request3(HttpServletRequest request) {
        Cookie[] cookies = request.getCookies();
        return BaseRespVo.ok();
    }
    @RequestMapping("request4")
    @ResponseBody
    public BaseRespVo request4(HttpServletRequest request) {
        HttpSession session = request.getSession();
        return BaseRespVo.ok();
    }

    @RequestMapping("request5")
    @ResponseBody
    public BaseRespVo request5(HttpSession session) {
        return BaseRespVo.ok();
    }
}
